package com.aprivate.leo.modularizationtemplateapp;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.aprivate.leo.commonlib.base.BaseActivity;
import com.aprivate.leo.commonlib.utils.ToastUtils;
import com.aprivate.leo.libannotation.BindPath;
import com.aprivate.leo.libarouter.Router;

@BindPath("app/main")
public class MainActivity extends BaseActivity {

    // Used to load the 'native-lib' library on application startup.
    static {
        System.loadLibrary("native-lib");
    }

    private TextView mTv;


    @Override
    protected int getLayoutRes() {
        return R.layout.activity_main;
    }

    @Override
    protected void initData() {
        showToast("this is main activity");
    }

    @Override
    protected void initView() {
        mTv = findViewById(R.id.sample_text);
        mTv.setText(stringFromJNI());

    }

    @Override
    protected void initListeners() {

    }

    /**
     * A native method that is implemented by the 'native-lib' native library,
     * which is packaged with this application.
     */
    public native String stringFromJNI();


    public void toAlpha(View view) {
        Router.getInstance().jumpToActivity("alpha/alpha", null);
    }
}
